#include <omp.h>
#include <stdio.h>

#define NHILOS 10
 
 int main (int argc, char *argv[]) {
   int th_id, nthreads;
   int var;
	
	omp_set_dynamic(0);
	var = omp_get_dynamic();
	printf("%d", var);
	
   omp_set_num_threads(NHILOS);
   
   #pragma omp parallel private(th_id)
   {
     th_id = omp_get_thread_num();
     printf("Hello World from thread %d\n", th_id);
     #pragma omp barrier
     if ( th_id == 0 ) {
       nthreads = omp_get_num_threads();
       printf("There are %d threads\n",nthreads);
     }
   }
	
   return 0;
 }
